/*
 *
 * Copyright (C) 2012 Walter Lütgenau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package offset.nodes;

import offset.nodes.maven.bundle.BundleConstants;

/**
 *
 * @author Walter Lütgenau
 */
public class Constants {

    public static final String PATH_SEPARATOR = "/";
    public static final String QUERY_SEPARATOR = "?";
    public static final String QUERY_PARAMETER_SEPARATOR = "&";
    public static final String QUERY_ASSIGNEMENT_OPERATOR = "=";
    public static final String QUERY_ATTRIBUTE_KEY = "@";
    public static final String URL_CHARSET = "UTF-8";
    public static final String QUERY_PRIMARY = "primary";

    // configuration
    public static final String CONFIG_WORKFLOW = "/jcr:system/nodes/workflows";
    public static final String CONFIG_TEMPLATES = "/jcr:system/nodes/templateInstances";
    public static final String CONFIG_ICONS = "/jcr:system/nodes/icons";
    public static final String CONFIG_NODETYPES = "/jcr:system/jcr:nodeTypes";

    // nodes namespace
    public static final String NAMESPACE_DELIMITER = ":";
    public static final String NAMESPACE_NODES = "nodes";

    // RMI access
    public static final String URL_RMI = "nodes";

    // path constants
    public static final String DIR_SYSTEM = "jcr:system";
    public static final String DIR_NODES = "jcr:system/nodes";
    public static final String DIR_ETC = "jcr:system/nodes/etc";
    public static final String DIR_CSS = "jcr:system/nodes/css";
    public static final String DIR_IMAGES = "jcr:system/nodes/images";

    // CSS constants
    public static final String CSS_MAIN = "main.css";
    public static final String CSS_FACES = "faces.css";

    // jcr constants
    public static final String JCR_ROOT = "jcr:root";
    public static final String JCR_PRIMARY_TYPE = "jcr:primaryType";
    public static final String JCR_UUID = "jcr:uuid";
    public static final String JCR_FILE = "nt:file";
    public static final String JCR_UNSTRUCTURED = "nt:unstructured";
    public static final String JCR_CONTENT = "jcr:content";
    public static final String JCR_DATA = "jcr:data";
    public static final String JCR_IS_MIXIN = "jcr:isMixin";
    public static final String JCR_MIXIN = "mix:";
    public static final String JCR_MIXIN_TYPES = "jcr:mixinTypes";
    public static final String JCR_VERSIONABLE = "mix:versionable";
    public static final String JCR_REFERENCEABLE = "mix:referenceable";
    public static final String JCR_LOCKABLE = "mix:referenceable";
    public static final String JCR_NT_BASE = "nt:base";
    public static final String JCR_NT_UNSTRUCTURED = "nt:unstructured";
    public static final String JCR_NT_RESOURCE = "nt:resource";
    public static final String JCR_TYPENAME_VERSION = "nt:version";
    public static final String PROP_MIME_TYPE = "jcr:mimeType";
    public static final String PROP_LAST_MODIFIED = "jcr:lastModified";
    public static final String PROP_DATA = "jcr:data";
    public static final String PROP_ENCODING = "jcr:encoding";
    public static final String PROP_SUCCESSORS = "jcr:successors";
    public static final String PROP_CHILD_VERSION_HISTORY = "jcr:childVersionHistory";
    public static final String PROP_VERSIONABLE_UUID = "jcr:versionableUuid";

    // jcr version constants
    public static final String JCR_FROZEN_NODE = "jcr:frozenNode";
    public static final String NT_FROZEN_NODE = "nt:frozenNode";
    public static final String JCR_FROZEN_PRIMARY_TYPE = "jcr:frozenPrimaryType";
    public static final String JCR_FROZEN_UUID = "jcr:frozenUuid";
    public static final String NT_VERSIONED_CHILD = "nt:versionedChild";
    public static final String JCR_CHILD_VERSION_HISTORY = "jcr:childVersionHistory";
    public static final String JCR_ROOT_VERSION = "jcr:rootVersion";
    public static final String JCR_CREATED = "jcr:created";
    public static final String JCR_SUCCESSORS = "jcr:successors";
    public static final String JCR_PREDECESSORS = "jcr:predecessors";
    public static final String PROP_JCR_BASE_VERION = "jcr:baseVersion";

    // jcr nodetype constants
    public static final String PROP_NODETYPE_NAME = "jcr:nodeTypeName";
    public static final String PROP_SUPERTYPES = "jcr:supertypes";
    public static final String TYPE_NODE_TYPE = "nt:nodeType";
    public static final String CHILD_PROPERTY_DEFINITION = "jcr:propertyDefinition";
    public static final String PROP_REQUIRED_TYPE = "jcr:requiredType";
    public static final String PROP_MULTIPLE = "jcr:multiple";
    public static final String PROP_VALUE_CONSTRAINTS = "jcr:valueConstraints";
    public static final String PROP_MANDATORY = "jcr:mandatory";
    public static final String CHILD_CHILDNODE_DEFINITION = "jcr:childNodeDefinition";
    public static final String PROP_DEFAULT_PRIMARY_TYPE = "jcr:defaultPrimaryType";
    public static final String PROP_REQUIRED_PRIMARY_TYPES = "jcr:requiredPrimaryTypes";
    public static final String PROP_SAME_NAME_SIBLINGS = "jcr:sameNameSiblings";

    // query pseudo columns
    public static final String JCR_SCORE = "jcr:score";
    public static final String JCR_PATH = "jcr:path";
    public static final String JCR_NAME_RESIDUAL = "*";
    public static final String JCR_NS_NT = "http://www.jcp.org/jcr/nt/1.0";

    // nodes constants
    public static final String URI_NODES = "http://www.nodes.de/nodes/1.0";
    public static final String URI_NODES_DATA = "http://offset.nodes.com/data/1.0";
    public static final String LOCALNAME_DATA = "data";
    public static final String CHILD_TEMPLATE_INSTANCES = "templateInstances";
    public static final String TYPENAME_CONTENT = "nodes:content";
    public static final String PROP_CONTENT_TYPE = "nodes:contentType";
    public static final String PROP_DEFAULT_CONTENT_TYPE = "nodes:defaultContentType";
    public static final String NODES_BODY = "nodes:body";
    public static final String NODES_VERSIONABLE = "nodes:versionable";
    public static final String TYPE_ONE_TO_ONE = "nodes:oneToOne";
    public static final String TYPE_NODES_FILE = "nodes:file";

    // constants of html
    public static final String TYPE_HTML_DIV = "nodes:htmlDiv";
    public static final String PROP_TEXT = "nodes:text";
    public static final String PROP_HYPERLINK = "nodes:hyperlink";
    public static final String CHILD_IMAGES = "nodes:images";
    public static final String MIME_HTML = "text/html";

    // constants of template nodes
    public static final String TYPE_TEMPLATE = "nodes:template";
    public static final String TYPE_TEMPLATE_NODE = "nodes:templateNode";
    public static final String TYPE_TEMPLATE_REPRESENTATION = "nodes:templateRepresentation";
    public static final String TYPE_VIRTUAL_FOLDER = "nodes:virtualFolder";
    public static final String TYPE_VIRTUAL_PAGE = "nodes:virtualPage";
    public static final String TYPE_TEMPLATE_REFERENCE = "nodes:templateReference";

    // constants of template instance nodes
    public static final String TYPE_TEMPLATE_INSTANCE = "nodes:templateInstance";
    public static final String TYPE_VIRTUAL_INSTANCE = "nodes:virtualInstance";
    public static final String TYPE_VIRTUAL_FOLDER_INSTANCE = "nodes:virtualFolderInstance";
    public static final String TYPE_VIRTUAL_PAGE_INSTANCE = "nodes:virtualPageInstance";

    // constants of template: properties and children
    public static final String PROP_NODETYPE = "nodes:nodeType";
    public static final String PROP_DEFAULT_TEMPLATE = "nodes:useAsDefault";
    public static final String PROP_NAME = "nodes:name";
    public static final String CHILD_ROOT = "nodes:root";


    // constants of templateNode: properties and children
    public static final String DATA_SECONDARY_QUERY = "/secondary";    
    public static final String PROP_PRIMARY_QUERY = "nodes:primaryQuery";
    public static final String PROP_SECONDARY_QUERY = "nodes:secondaryQuery";
    public static final String PROP_SELECT_QUERY = "nodes:selectQuery";
    public static final String CHILD_TEMPLATE_NODE_CHILD = "nodes:templateNodeChild";
    public static final String CHILD_REPRESENTATION = "nodes:representation";

    // constants of templateRepresentation: properties and children
    public static final String PROP_NAME_PROPERTY = "nodes:nameProperty";

    // constants of virtualPage: children
    public static final String CHILD_SAMPLE = "nodes:sample";
    public static final String CHILD_TRANSFORMATION = "nodes:transformation";
    public static final String CHILD_EDITORTRANSFORMATION = "nodes:editorTransformation";
    public static final String CHILD_CSS = "nodes:styleSheet";

    // constants of templateReference: properties
    public static final String PROP_REFERENCE = "nodes:reference";

    // constants of virtualFolderInstance and virtualPageInstance
    public static final String PROP_TEMPLATE_NODE_REFERENCE = "nodes:templateNodeReference";
    public static final String CHILD_TEMPLATE_INSTANCE = "nodes:virtualChild";

    // constants for multi pages
    public static final String TYPE_ABSTRACT_MULTIPAGE = "nodes:abstractMultipage";
    public static final String TYPE_SIMPLE_MULTIPAGE = "nodes:simpleMultipage";

    // constants for workflow nodes
    public static final String TYPE_WORKFLOW = "nodes:workflow";
    public static final String TYPE_WORKFLOW_DOCUMENT = "nodes:workflowDocument";
    public static final String TYPE_STATE = "nodes:state";
    public static final String PROP_CURRENT_STATE = "nodes:workflowState";
    public static final String PROP_WORKFLOW = "nodes:workflow";
    public static final String PROP_DESCRIPTION = "nodes:description";
    public static final String CHILD_TEMPLATE_EDITOR = "nodes:templateEditor";
    public static final String TYPE_TEMPLATE_EDITOR = "nodes:templateEditor";
    public static final String PROP_EDITOR_VIRTUAL_PAGE_INSTANCE = "nodes:virtualPageInstance";
    public static final String CHILD_BUILT_IN_EDITOR = "nodes:builtInEditor";
    public static final String PROP_RELATIVE_PATH = "nodes:relativePath";
    public static final String PROP_TRANSITION = "nodes:transition";
    public static final String PROP_ROLE = "nodes:role";
    public static final String PROP_NEW_STATE = "nodes:new";
    public static final String PROP_DIRECT_EDIT = "nodes:directEdit";
    public static final String PROP_DOCUMENT_TYPE = "nodes:documentType";
    public static final String CHILD_TEMPLATE = "nodes:template";
    public static final String CHILD_INSTANCE = "nodes:instance";


    // constants concerning versioning
    public static final String TYPE_VERSIONABLE = "nodes:versionable";
    public static final String PROP_CREATOR = "nodes:creator";
    public static final String PROP_COMMENT = "nodes:comment";

    // constants for access control
    public static final String TYPENAME_ACCESS_CONTROLLER = "nodes:accessController";
    public static final String TYPENAME_ACCESS_CONTROL = "nodes:accessControl";
    public static final String TYPENAME_ACCESS_CONTROL_ENTRY = "nodes:accessControlEntry";
    public static final String TYPENAME_USER = "nodes:user";
    public static final String TYPENAME_ROLE = "nodes:role";
    public static final String TYPENAME_PASSWORD = "nodes:password";
    public static final String TYPENAME_PRINCIPAL = "nodes:principal";
    public static final String TYPENAME_PRINCIPAL_ROLE = "nodes:acRole";
    public static final String TYPENAME_PRINCIPAL_USER = "nodes:acUser";
    public static final String TYPENAME_PRIVILEGES = "nodes:privileges";
    public static final String TYPENAME_PRIVILEGE = "nodes:privilege";
    public static final String PROP_PRESENCE = "nodes:presence";
    public static final String PROP_USER_REFERENCE = "nodes:user";
    public static final String PROP_USER_PASSWORD = "nodes:password";
    public static final String VALUE_GRANTED = "granted";
    public static final String VALUE_DENIED = "denied";
    public static final String PRIVILEGE_READ = "read";
    public static final String PRIVILEGE_ADD_NODE = "addNode";
    public static final String PRIVILEGE_REMOVE_NODE = "removeNode";
    public static final String PRIVILEGE_SET_PROPERTY = "setProperty";
    public static final String PRIVILEGE_REMOVE_PROPERTY = "removeProperty";

    // constants for xpath search
    public static final String TYPENAME_XPATH_SEARCH = "nodes:xpathSearch";
    public static final String PROP_QUERY = "nodes:query";
    public static final String QUERY_ROOT_ANCESTOR_NAME = "ANCESTOR_NAME";
    public static final String QUERY_ROOT_ANCESTOR_TYPE = "ANCESTOR_TYPE";
    
    // constants for spring beans
    public static final String TYPENAME_SPRING_BEAN = "nodes:springBean";
   public static final String TYPENAME_SPRING_PROPERTY = "nodes:springProperty";
   public static final String TYPENAME_SPRING_STRING = "nodes:springString";
   public static final String TYPENAME_SPRING_REFERENCE = "nodes:springReference";
   public static final String PROP_PACKAGE_NAME = "nodes:package";
   public static final String PROP_CLASS_NAME = "nodes:class";
   public static final String PROP_SCOPE = "nodes:scope";
   public static final String PROP_VALUE = "nodes:value";
   public static final String PROP_KEY = "nodes:key";
   public static final String VALUE_SINGLETON = "SINGLETON";

    // other constants
    public static final String QUERY_ANCESTOR = "ancestor";
    public static final String QUERY_ELEMENT = "element";
    public static final String CONTEXTMAPPING_NODES = "nodes";
    public static final String SERVLETMAPPING_REPOSITORY = "registry";
    public static final String SERVLETMAPPING_FACES = "faces";
    public static final String SERVLETMAPPING_STRUTS = "struts";
    public static final String SERVLETMAPPING_DIALOG = "dialog";
    public static final String SERVLETMAPPING_DOWNLOAD = "download";

    // http query parameters
    public static final String PAR_CONTENT_TYPE = "contentType";
    public static final String PAR_QUERY = "query";
    public static final String PAR_QUERY_TYPE = "queryType";
    public static final String PAR_DATA_REFERENCE = "ref";
    public static final String PAR_NODE_REFERENCE = "reference";
    public static final String PARVALUE_XPATH = "xpath";
    public static final String PARVALUE_SEARCH = "search";
    public static final String PAR_MODE = "mode";
    public static final String PAR_DIR = "dir";
    public static final String PAR_TRANSITION = "transition";
    public static final String PARVALUE_APPLET = "applet";
    public static final String PARVALUE_PRINT = "print";
    public static final String PARVALUE_EDIT = "edit";
    public static final String PAR_NODE_TYPE = "nodeType";
    public static final String PAR_PROPERTY_TYPE = "propertyType";
    public static final String PAR_PROPERTY_NAME = "propertyName";
    public static final String PAR_PROPERTY_VALUE = "propertyValue";
    public static final String PAR_TEMPLATE_INSTANCE_REFERENCE = "vref";
    public static final String PAR_RESULT = "result";
    public static final String PARVALUE_OK = "ok";
    public static final String PARVALUE_CANCEL = "cancel";
    public static final String CONTENT_TYPE_DEFAULT = "data";
    public static final String CONTENT_TYPE_VIRTUAL = "virtual";
    public static final String CONTENT_TYPE_HTML = "html";
    public static final String CONTENT_TYPE_BINARY = "binary";
    public static final String CONTENT_TYPE_CSS = "css";
    public static final String CONTENT_TYPE_STYLESHEET = "xslt";
    public static final String CONTENT_TYPE_TEMPLATE = "template";
    public static final String CONTENT_TYPE_WORKFLOW = "workflow";
    public static final String CONTENT_TYPE_ICON = "icon";

    // mime types
    public static final String MIMETYPE_CSS = "text/css";
    public static final String MIMETYPE_JAVASCRIPT = "text/javascript";
    public static final String EXTENSION_JAVASCRIPT_INLINE = "jsinline";

    // startup extension constants
    public static final String TYPENAME_CREATION = "nodes:creation";
    public static final String TYPENAME_MODIFICATION = "nodes:modification";
    public static final String PROP_CREATION_USER_ID = "nodes:creatorId";
    public static final String PROP_CREATION_TIMESTAMP = "nodes:creationTime";
    public static final String PROP_MODIFICATION_USER_ID = "nodes:modifierId";
    public static final String PROP_MODIFICATION_TIMESTAMP = "nodes:modificationTime";
    public static final String TYPENAME_SHORT_ID = "nodes:shortId";
    public static final String TYPENAME_SHORT_ID_DEMARCATOR = "nodes:shortIdDemarcator";
    public static final String PROP_SHORT_ID = "nodes:id";
    public static final String PROP_BASE_ID = "nodes:baseId";
    public static final String CHILD_SHORT_IDS = "shortIds";
    public static final String TYPENAME_SEQUENCE = "nodes:sequence";
    public static final String PROP_SEQUENCE_NUMBER = "nodes:sequenceNumber";
    public static final String SHORT_ID_SEPARATOR = "-";
    public static final String PROP_DEMARCATOR_ID = "nodes:demarcatorId";
    public static final String TYPENAME_TASK = "nodes:task";
    public static final String PROP_OPTIMISTIC_ESTIMATION = "nodes:optimisticEstimation";
    public static final String PROP_PESSIMISTIC_ESTIMATION = "nodes:pessimisticEstimation";
    public static final String PROP_MOST_LIKELY_ESTIMATION = "nodes:mostLikelyEstimation";
    public static final String PROP_WORK_DONE = "nodes:done";

    // constants for icons
    public static final String CHILD_ICONS = "icons";
    public static final String CHILD_ICON = "icon";
    public static final String CHILD_DEFAULT_NODE_TYPE = "defaultNodeType";
    public static final String CHILD_DEFAULT_PROPERTY_TYPE = "defaultPropertyType";
    public static final String CHILD_DEFAULT_PROPERTY_VALUE = "defaultPropertyValue";

    // constants for bundles
    public static final String TYPENAME_BUNDLE = BundleConstants.TYPENAME_BUNDLE;
    public static final String TYPENAME_BUNDLE_ENTRY = BundleConstants.TYPENAME_BUNDLE_ENTRY;
    public static final String PROP_BUNDLE = BundleConstants.PROP_BUNDLE;
    public static final String PROP_MODULE = BundleConstants.PROP_MODULE;
    public static final String PROP_PACKAGE_PATH = BundleConstants.PROP_PACKAGE_PATH;
    public static final String PROP_DEFAULT_LANGUAGE = BundleConstants.PROP_DEFAULT_LANGUAGE;

    // constants for task nodes
    public static final String CHILD_DESCRIPTION = "nodes:description";
    
    // n-data (used both by virtual editor as well as from navigation
    public static final String ATTRIBUTE_DATA = "n-data";

}
